#FROM bewithmeallmylife/mmocr-runtime-cuda-10.2:1.0.0
FROM bewithmeallmylife/mmocr-runtime-cuda-11.1.1:1.0.0

USER root
ENV PATH /root/anaconda3/bin:$PATH
SHELL ["conda", "run", "-n", "python3.8", "/bin/bash", "-c"]
ENV LANGUAGE zh_CN:zh

WORKDIR /app/mmocr

ENV FORCE_CUDA="1"
ADD checkpoints  checkpoints
ADD configs configs
ADD demo demo
ADD data data
ADD mmocr mmocr
ADD tests tests
ADD tools tools
ADD README.md README.md
ADD resources resources
ADD setup.cfg setup.cfg
ADD setup.py  setup.py
RUN python setup.py install
#ADD hello.py hello.py
CMD ["/root/anaconda3/envs/python3.8/bin/python","mmocr/utils/ocr.py","demo/label-zh-CN.png","--print-result","--imshow"]
#sudo docker build -t='bewithmeallmylife/mmocr-app-cuda-10.2:1.0.0' .
#sudo docker build -t='bewithmeallmylife/mmocr-app-cuda-11.1:1.0.0' .

#Run comman 'xhost local:root' to avoid qt.qpa.screen: QXcbConnection: Could not connect to display :1  error
#xhost local:root
#sudo docker run --net=host  --gpus '"device=0"' --privileged --rm -it -v /dev/video0:/dev/video0 -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -u root bewithmeallmylife/mmocr-app-cuda-10.2:1.0.0
#sudo docker run --net=host  --gpus '"device=0"' --privileged --rm -it -v /dev/video0:/dev/video0 -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -u root bewithmeallmylife/mmocr-app-cuda-11.1:1.0.0
